"use strict";
//主要用来定义标识符
/*
  pay_status: 0 未支付 1 支付 2 交易成功
  如果但用数字一段时间之后你还能记得?
  类似的 flag ...
*/
var flag;
(function (flag) {
    flag[flag["success"] = 1] = "success";
    flag[flag["error"] = -1] = "error";
})(flag || (flag = {}));
var vari = flag.success;
console.log(vari);
//先定义一个类型,如果不赋值,默认就是0,1,2索引值
var Color;
(function (Color) {
    Color[Color["red"] = 0] = "red";
    Color[Color["blue"] = 1] = "blue";
    Color[Color["orange"] = 2] = "orange";
})(Color || (Color = {}));
var c = Color.blue;
//:类型=类型下的值
console.log(c);
//这里输出 1
var letter;
(function (letter) {
    letter[letter["A"] = 0] = "A";
    letter[letter["B"] = 5] = "B";
    letter[letter["C"] = 6] = "C";
})(letter || (letter = {}));
var l = letter.C;
//:类型=类型下的值
console.log(l);
//这里输出 6,默认以上一个作为开始
